package com.enotourister.core.model;

public class Tourist implements java.io.Serializable {
	private static final long serialVersionUID = 178466779715297172L;
	
	private String email;
	private String fullname;
	
	public Tourist(String email, String fullname) {
		this.email = email;
		this.fullname = fullname;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getFullname() {
		return fullname;
	}

	public void setFullname(String fullname) {
		this.fullname = fullname;
	}
	
	@Override
	public int hashCode() {
		return (getFullname().hashCode() * 31) ^ getEmail().hashCode();
	}
	
	@Override
	public boolean equals(Object obj) {
		boolean equal = false;
		
		if (obj instanceof Tourist) {
			Tourist other = (Tourist)obj;
			
			if (getFullname().equals(other.getFullname()) &&
					getEmail().equals(other.getEmail())) 
				equal = true;
		}
		
		return equal;
	}
}
